package org.okcjug.december.model;

import java.util.ArrayList;
import java.util.List;

public class Movie implements Comparable<Movie>{
	
	private List<String> quotes;
	private String movie;
	
	public Movie(String movie, List<String> quotes){
		this.movie = movie;
		this.quotes = new ArrayList<String>(quotes);
	}
	
	/**
	 * @return the quote
	 */
	public List<String> getQuotes() {
		return new ArrayList<String>(quotes);
	}

	/**
	 * @param quote the quote to set
	 */
	public void setQuotes(List<String> quotes) {
		this.quotes = new ArrayList<String>(quotes);
	}

	/**
	 * @return the movie
	 */
	public String getMovie() {
		return movie;
	}

	/**
	 * @param movie the movie to set
	 */
	public void setMovie(String movie) {
		this.movie = movie;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((movie == null) ? 0 : movie.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final Movie other = (Movie) obj;
		if (movie == null) {
			if (other.movie != null)
				return false;
		} else if (!movie.equals(other.movie))
			return false;
		return true;
	}
	
	public String toString()
	{
		return getMovie() + " - " + getQuotes() + "\n";
	}

	@Override
	public int compareTo(Movie o) {
		return movie.compareTo(o.getMovie());
	}
}
